package demo1;

public class Test {
    public static void func(Animal animal){
        animal.eat();

    }

    public static void main(String[] args) {
        Dog dog=new Dog("旺财",2);
        Cat cat=new Cat("喵喵",3);
        func(dog);
        func(cat);
    }
}
